<html>
<title>TAXI Scheduler Phototype</title>
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' /> 
<meta http-equiv= "Content-Type" content= "text/html;charset=gb2312">
<body style="color:#fff;background:#333">
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<div style='width:100%;height:auto'>
<script type="text/javascript">
$(document).ready(function()
{
	function success(position) {
	var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
	var geocoder = new google.maps.Geocoder();
  
	geocoder.geocode({'latLng': latlng}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
		if (results[1]) {
			// alert(results[1].formatted_address);
			// alert("=== lat="+position.coords.latitude+", lot="+position.coords.longitude);
			
			var xmlhttp;
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
					alert(xmlhttp.responseText);
				}
			}
			var url = "/TaxiScheduler/phpGeo.php?location=" + position.coords.latitude+","+position.coords.longitude;
			xmlhttp.open("GET",url,true);
			xmlhttp.send();
        } else {
			alert("No results found");
        }
		} else {
		alert("Geocoder failed due to: " + status);
		}
	});
	}
	
	function error(msg) {
		alert("Failed");
	}
	
	if (navigator.geolocation) {
		navigator.geolocation.getCurrentPosition(success, error);
	} else {
		error('not supported');
	}

	window._alert=window.alert;
	window.alert=function(s) {
	_alert(s.replace(/&#(\d{5});/g,function(r,r1) {return String.fromCharCode(r1);}));
	} 
});

</script>
</div>
<div id="myDiv"></div>
<button type="button" onclick="#">Pls order Taxi for me!</button>
</body>
</html>